0 CLS:CLEAR1000:DIMD(500),I,J,K,A$,C:C=16384:GOSUB190:GOTO40
1 C1=1:CC=32
2 IFMID$(M$,CC,1)<>""ANDMID$(M$,CC,1)<>" "THENCC=CC-1:GOTO2
3 PRINTMID$(M$,C1,CC-C1):C1=CC+1:CC=C1+31:IFC1<=LEN(M$)THEN2
4 RETURN
5 KA=VARPTR(D(0))+97:KB=KA+2251:RETURN
20 DATA"NONE",0,0,"LEATHER",150,30,"RING MAIL",350,100,"CHAIN MAIL",500,150,"PARTIAL PLATE",750,250
21 DATA"FULL PLATE",1000,1000,"INTELLIGENCE","INTUITION","EGO","STRENGTH","CONSTITUTION","DEXTERITY"
22 DATA"DAGGER",1,5,5,3,7,12,"SHORTSWORD",2,14,6,8,9,12,"BROADSWORD",3,18,7,10,9,13,"HAND-AND-A-HALF SWORD",6,35,8,16,9,14
23 DATA"GREAT SWORD",9,70,10,15,7,15,"MAGIC SWORD"
24 DATA6,3,10,8,15,12,5,15,6,17
25 DATA"I'D NOT PART WITH THESE FINE GOODS FOR THAT PITTANCE! MAYHAP FOR",5
26 DATA"NOT SO CHEAP MY FRIEND! BUT FOR THEE JUST",10
27 DATA"BLACKHEART! THOU TAKEST THE FOOD FROM MY CHILDREN'S MOUTHS! I'LL NOT SETTLE FOR LESS THAN",5
28 DATA"WELL, LIFE IS SHORT AND THY ARSE LONG! WHAT SAY THEE TO",2
29 DATA"HMM...BUT SUCH FINE WORKMANSHIP. I COULD NOT PART WITH THIS FOR LESS THAN",10,"A POX ON THEE! BUT I'D TAKE",3
30 DATA"NONE","SMALL","LARGE"
40 DIMNA$(5),W(5),P(5),NC$(6),CH(6),SD(2),SP(2),SW(2),NW$(6),WW(5),WP(5),WD(5),WR(5),DS(1,1),DW(5,1),R$(6),RR(6)
42 DIMNS$(2),T(20,4),N,L,Q,LS,SM,RN,RT,WC,KB,KA,OM,C$,PS,WP,SP,PB,PA,MO,SE,JJ,WW,LV,J8,J0,J7,JQ,C1,CC,M$
43 DIMAN$,LQ,IA,AM,AA,LO,AK,A1,OO,HB,SC,EX,RS,RM,HS,HN,EG,IN,AS,CA,IT,DX,E,W2,M,R,WM,B,WN,I1,RQ,NM$
44 C1=RND(-(PEEK(9)*256+PEEK(10))):Q=60
50 J8=248:J0=59:J7=249:JQ=1
70 FORI=0TO5:READNA$(I),W(I),P(I):W(I)=INT(W(I)/16+.5):NEXTI
80 W(0)=0:FORI=1TO6:READNC$(I):NEXTI
100 FORI=1TO5:READNW$(I),WW(I),WP(I),WD(I),WR(I):FORJ=0TO1:READDW(I,J):NEXTJ:NEXTI:READNW$(6)
120 FORI=1TO2:READSW(I),SD(I),SP(I):FORJ=0TO1:READDS(I-1,J):NEXTJ:NEXTI
130 LS=0:SM=0
160 RN=6:RT=0:FORI=1TORN:READR$(I),RR(I):RT=RT+RR(I):NEXTI
170 FORI=0TO2:READNS$(I):NEXTI:FORI=1TO20:FORJ=1TO4:READT(I,J):NEXTJ:NEXTI
180 GOTO270
190 PRINT@138,"DUNJONQUEST":PRINT@70,"THE TEMPLE OF APSHAI":PRINT@297,"COPYRIGHT 1979":PRINT@357,"AUTOMATED  SIMULATIONS"
210 FORI=0TO30:PRINT@I,"¿";:PRINT@I+480,"¿";:NEXTI:FORI=31TO480STEP32:PRINT@I,"¿¿";:NEXTI:POKE16895,191:
215 PRINT@452,"MC-10 EDITS-- JIM GERRIE";:RETURN
220 FORI=417TO446:PRINT@I,"¿";:NEXTI:PRINT@452,"HIT ANY KEY TO CONTINUE   ";
240 A$=INKEY$:IFLEN(A$)=0GOTO240
250 RETURN
270 GOSUB220:CLS:GOSUB700:GOSUB5:POKEKB,0
280 CLS:WC=5:PRINT"THUS QUOTH THE INNKEEPER:"
290 IFPEEK(KB-12)=123THENPRINT"DOST THOU WISH TO KNOW WHAT":INPUT"TREASURES THOU HAST";A$:IFLEFT$(A$,1)="Y"THENGOSUB2060
300 IFPEEK(KB-12)=123THENGOSUB1790
310 IFPEEK(KB-12)=123THEN315
311 GOTO320
315 M$="I TRUST THINE WAS A PLEASANT SOJOURN WITHIN THE TEMPLE.":GOSUB1
316 PRINT"ART THOU BUT PASSING THROUGH":INPUT"THE INN AND WISH TO RETURN";A$
317 IFLEFT$(A$,1)="Y"THENGOSUB2020:GOSUB2080:OM=MO:GOSUB1330:GOTO350
320 POKEKB-12,0
330 M$="HAIL AND WELL MET! SHALL I FIND THEE A GOODLY CHARACTER, OR HAST THOU BROUGHT ONE WITH THEE?":GOSUB1
331 M$="PRITHEE, SAY YEA IF I SHOULD.":GOSUB1:INPUTC$:IFLEFT$(C$,1)="Y"THENGOSUB850:GOTO340
332 GOSUB940
340 OM=MO:INPUT"CHARACTER NAME";NM$:IFMO>0THENGOSUB1330
350 IFMO>0THENGOSUB1460
360 IFPS=0THENWP=WP+SP:SP=0
370 PB=PB-WP-INT(PEEK(KB+15)/2):IFWP>0THENPA=PA+WP-1:GOTO380
371 IFWP<0THENPA=PA+WP+1
380 IFMO=0GOTO410
381 GOSUB750
390 IFMO=0GOTO410
391 GOSUB1550
400 IFMO=0GOTO410
401 GOSUB1630
410 SE=100
420 M$="MONSTER SPEED (SLOW, MEDIUM, OR FAST)?":GOSUB1:INPUTC$:IFLEFT$(C$,1)="S"THENSE=250:GOTO430
421 IFLEFT$(C$,1)="F"THENSE=60:GOTO430
422 SE=120
430 POKEKB+9,SE:POKEKB+11,HS:POKEKB+13,RS:POKEKB+14,RM:POKEKB+12,WC:POKEKB+7,WM
440 POKEKB+24,CA:POKEKB+6,HN:POKEKB+11,HS
450 POKEKB+23,AS:POKEKB+7,WM:POKEKB+18,PB:POKEKB+19,PA:POKEKB+21,IT:POKEKB+22,EG:POKEKB+4,SP:POKEKB+25,DX
451 D(498)=EX
460 WC=5+WW(PEEK(KB+17))+W(AA)+SW(INT(PEEK(KB)/2))+1+(RS+RM)/10
470 POKEKB+13,RS:POKEKB+14,RM:POKEKB+12,WC:POKEKB+20,CH(1)
480 POKEKB+10,SM
490 POKEKB,PS
500 POKEKB+8,AA:IFPEEK(KB-12)=123GOTO540
510 J=LEN(NM$):IFJ>11THENJ=11
520 FORI=1TOJ:POKEKB-12+I,ASC(MID$(NM$,I,1)):NEXTI
530 IFJ<11THENFORI=J+1TO11:POKEKB-12+I,ASC(" "):NEXTI
540 GOSUB1790
550 POKEKB-12,123
560 INPUT"ENTER DUNGEON NAME";A$:INPUT"PRESS play & record";C$:SAVE*D,LEFT$(A$,8)
690 PRINT"NOW RUN DUNJONMASTER":END
700 INPUT"ENTER DUNGEON NAME";A$:PRINT"PRESS PLAY":LOAD*D,LEFT$(A$,8):MO=D(499):RETURN
750 INPUT"WILT THOU BUY NEW ARMOUR";A$:IFLEFT$(A$,1)="Y"THEN755
751 RETURN
755 FORI=1TO900:NEXTI:CLS:PRINT"TYPE"TAB(12)"WEIGHT"TAB(20)"ASKING PRICE"
760 FORI=1TO5:PRINTLEFT$(NA$(I),13)TAB(14)W(I)TAB(22)P(I):NEXTI
770 M$="WHAT SORT OF ARMOUR WOULDST THOU WEAR?":GOSUB1:INPUTA$:IFLEFT$(A$,1)="N"THENAM=0:AA=0:RETURN
780 FORI=1TO5:IFLEFT$(A$,2)=LEFT$(NA$(I),2)THENN=I:GOTO810
790 NEXTI:M$="I HAVE NOT "+A$+" FOR SALE":GOSUB1:GOTO770
800 IFPEEK(KB-12)=123THENWC=WC-W(AA)
810 LO=.3*P(N):AK=P(N):A1=AK:GOSUB1670:IFOO=0GOTO770
820 AA=N:MO=MO-OO:WC=WC+W(N):POKEKB+16,0
830 ONRND(2)GOTO835:M$="THOU HAST"+STR$(MO)+" SILVER PIECES LEFT IN THY PURSE":GOSUB1:RETURN
835 M$="THOU HAST"+STR$(MO)+" REMAINING":GOSUB1:RETURN
840 J=RND(6)+RND(6)+RND(6):RETURN
850 HB=0:SC=0:FORI=1TO6:GOSUB840:CH(I)=J:SC=SC+J:NEXTI:IFSC<60ORCH(4)<8ORCH(5)<7GOTO850
860 EX=0:RS=0:RM=0:AA=0:PS=0:POKEKB+17,0:SP=0:WP=1:AM=0:SM=0:HS=0:HN=0:POKEKB+15,1
870 CLS:PRINT"THY QUALITIES:":FORI=1TO6:PRINTNC$(I);TAB(25);CH(I):NEXTI
880 FORI=1TO6:POKEKA-97+I,CH(I):NEXTI
890 PRINT:GOSUB840:MO=J*10:GOSUB830
900 GOSUB930:L=1:POKEKB+16,0
910 EG=CH(3):IN=CH(1):AS=CH(4):CA=CH(5):IT=CH(2):DX=CH(6):PA=11:PB=11
920 RETURN
930 FORI=KA-90TOKA-81:POKEI,0:NEXTI:RETURN
940 POKEKB+15,0:FORI=1TO6:PRINT"ENTER "NC$(I);:INPUTCH(I):POKEKA-97+I,CH(I)
941 IFCH(I)>18THENM$=MID$(STR$(CH(I))+" BE TOO HIGH. NO MORE THAN 18 CAN IT BE.",2):GOSUB1:I=I-1
950 NEXTI
960 INPUT"THY EXPERIENCE";EX
961 IFEX>16000000THENM$="THY CHARACTER IS TOO WORLDWISE; FIND ANOTHER MY FRIEND":GOSUB1:GOTO940
970 E=EX/1000:FORL=1TO20:IF2^L>ETHEN980
971 NEXTL
980 M$="HOW MUCH MONEY HAST THOU TO SPEND?":GOSUB1:INPUTMO
990 GOSUB1120
1000 M$="WHAT KIND OF SWORD HAST THOU?":GOSUB1:INPUTA$:FORI=1TO5
1001 IFLEFT$(A$,1)=LEFT$(NW$(I),1)THENIFCH(4)>=WR(I)THENN=I:OO=0:GOSUB1420:GOTO1020
1010 NEXTI:M$="THOU CANNOT TAKE A "+A$+" TO THE DUNJON. THOU MUST BUY ANOTHER.":GOSUB1:GOTO1000
1020 M$="WHAT SORT OF ARMOUR DOST THOU WEAR?":GOSUB1:INPUTA$:FORI=0TO5
1021 IFLEFT$(A$,2)=LEFT$(NA$(I),2)THENN=I:OO=0:GOSUB820:GOTO1040
1030 NEXTI:M$="THOU CANNOT WEAR "+A$+" IN THE DUNJON":GOSUB1:GOTO1020
1040 N=0:INPUT"HAST THOU A SHIELD";A$:IFLEFT$(A$,1)="Y"THENINPUT"BE IT LARGE OR SMALL";A$:N=1:IFLEFT$(A$,1)="L"THENN=2
1050 IFN>0THENGOSUB1500
1060 INPUT"HAST THOU A BOW";A$:IFLEFT$(A$,1)="Y"THENHB=1:GOTO1070
1061 HB=0
1070 INPUT"HOW MANY ARROWS HAST THOU";RS:M$="HOW MANY MAGIC ARROWS HAST THOU?":GOSUB1:INPUTRM
1071 IFRS+RM>60THENM$="THOU CANST CARRY BUT 60 ARROWS.":GOSUB1:GOTO1070
1080 M$="HOW MANY HEALING POTIONS HAST THOU NOW?":GOSUB1:INPUTHN
1081 M$="HOW MANY HEALING SALVES HAST THOU?":GOSUB1:INPUTHS:IFHS>10THENHS=10
1090 INPUT"IS THY SWORD MAGICAL";A$:IFLEFT$(A$,1)="Y"THENINPUT"WHAT BE THE PLUS";SM
1100 POKEKB+16,0:INPUT"IS THY ARMOUR MAGICAL";A$:IFLEFT$(A$,1)="Y"THENINPUT"WHAT BE THE PLUS";AM:POKEKB+16,AM
1110 GOSUB930:GOTO910
1120 IFW2=1THENWP=L:SP=0:GOTO1130
1121 WP=INT((L+1)/2):SP=L-WP
1130 IFPEEK(KB+15)=LTHENRETURN
1131 POKEKB+15,L
1140 IFPEEK(KB-12)=123THENJ=L-1:L=2:ONJGOTO1150,1170,1190,1210,1230,1150,1170,1190,1210,1230
1150 L=L-1:IFL=0GOTO1260
1160 IFCH(5)<9THENCH(5)=CH(5)+1:GOTO1170
1161 CH(4)=CH(4)+1
1170 L=L-1:IFL=0GOTO1260
1180 IFCH(6)<9THENCH(6)=CH(6)+1:GOTO1190
1181 CH(5)=CH(5)+1
1190 L=L-1:IFL=0GOTO1260
1200 CH(5)=CH(5)+1
1210 L=L-1:IFL=0GOTO1260
1220 IFCH(6)<9THENCH(6)=CH(6)+1:GOTO1230
1221 IFCH(4)<CH(5)THENCH(4)=CH(4)+1:GOTO1230
1222 CH(5)=CH(5)+1
1230 L=L-1:IFL=0GOTO1260
1240 IFCH(2)<CH(3)THENCH(2)=CH(2)+1:GOTO1150
1241 CH(3)=CH(3)+1
1250 GOTO1150
1260 FORI=1TO6:M=CH(I)-18:IFM<=0GOTO1320
1270 CH(I)=18:FORJ=1TOM:IFCH(4)<18THENCH(4)=CH(4)+1:GOTO1310
1280 IFCH(5)<18THENCH(5)=CH(5)+1:GOTO1310
1290 IFCH(6)<18THENCH(6)=CH(6)+1:GOTO1310
1300 R=RND(3):CH(R)=CH(R)+1
1310 NEXTJ
1320 NEXTI:CA=CH(5):AS=CH(4):DX=CH(6):EG=CH(3):IT=CH(2):RETURN
1330 M$="WILT THOU BUY ONE OF OUR FINE SWORDS?":GOSUB1:INPUTA$:IFLEFT$(A$,1)="N"THENN=PEEK(KB+17):GOSUB1430:RETURN
1331 W2=0
1340 PRINT"WEAPON"TAB(10);"WEIGHT"TAB(20);"ASKING PRICE"
1350 FORI=1TO5:PRINTRIGHT$(NW$(I),11);TAB(14);WW(I);TAB(20);WP(I):NEXTI
1360 M$="WHAT WEAPON WILT THOU PURCHASE?":GOSUB1:INPUTA$:FORI=1TO5:IFLEFT$(A$,1)="-"THENA$="H"
1361 IFLEFT$(A$,1)=LEFT$(NW$(I),1)THENN=I:GOTO1380
1362 IFLEFT$(A$,1)="N"THENN=PEEK(KB+17):GOSUB1430:RETURN
1370 NEXTI:M$="I HAVE NOT SUCH A WEAPON AS A "+A$:GOSUB1:GOTO1360
1380 IFWR(N)>ASTHENM$="THOU CANNOT WIELD SUCH A GREAT WEAPON":GOSUB1:GOTO1360
1390 M$="FEAST THY EYES 'PON THIS FINE "+NW$(N):GOSUB1
1391 PRINT"'TIS WELL FORGED IRON"
1400 LO=.3*WP(N):AK=WP(N):A1=AK:GOSUB1670:IFOO=0GOTO1360
1410 MO=MO-OO:GOSUB830
1420 WM=INT(WD(N)*AS/10+.5):SM=0:POKEKB+10,0:POKEKB+17,N:WC=WC+WW(N):IFN=5THENW2=1
1430 IFDW(N,0)>CH(6)THENWP=WP+CH(6)-DW(N,0):GOTO1440
1431 IFDW(N,1)<CH(6)THENWP=WP+CH(6)-DW(N,1)
1440 IFWP>0THENWP=INT(1.3*LOG(WP)+1)
1450 RETURN
1460 IFW2=1THENPS=0:POKEKB,0:SP=0:RETURN
1470 INPUT"WILT THOU BUY A SHIELD";A$:IFLEFT$(A$,1)="N"THENGOSUB1520:RETURN
1471 PRINT"SHIELD     WEIGHT     ASK"
1472 PRINT"SMALL"TAB(11);SW(1);TAB(22);SP(1):PRINT"LARGE"TAB(11);SW(2);TAB(22);SP(2)
1473 INPUT"WHAT SORT";C$:IFLEFT$(C$,1)="L"THENN=2:GOTO1480
1474 N=1
1480 IFLEFT$(C$,1)="L"THENN=2:GOTO1490
1481 IFLEFT$(C$,1)="S"THENN=1:GOTO1490
1482 N=0:POKEKB,0:PS=0:RETURN
1490 LO=.3*SP(N):AK=SP(N):A1=AK:GOSUB1670:IFOO=0THENGOTO1470
1500 IFDS(N-1,0)>DXTHENSP=SP+DX-DS(N-1,0):GOTO1510
1501 IFDS(N-1,1)<DXTHENSP=SP+DX-DS(N-1,1)
1510 MO=MO-OO:GOSUB830:WC=WC+SW(N):PS=SD(N):POKEKB,PS:GOSUB1520:RETURN
1520 IFPS=5THENSP=INT(SP/2)
1530 IFSP>0THENSP=INT(1.3*LOG(SP)+1)
1540 SP=2*PS+SP:RETURN
1550 IFHB>0GOTO1590
1560 INPUT"WILT THOU BUY A BOW";C$:IFLEFT$(C$,1)="N"THENRETURN
1570 M$="I'VE A FINE BOW, YEW AND NEARLY NEW, FOR 12 SILVER PIECES":GOSUB1:LO=4:AK=12:A1=AK:GOSUB1670:IFOO=0THENRETURN
1580 MO=MO-OO:GOSUB830
1590 IFRS+RM>60THENRS=60-RM:GOTO1620
1600 N=0:M$="HOW MANY ARROWS WILT THOU BUY (AT 5 COPPERS EACH)?":GOSUB1:INPUTN
1601 IFINT((N+1)/2)>MOTHENPRINT"NO CREDIT":GOTO1600
1602 IFRS+RM+N>60THENM$="THOU CANST CARRY BUT 60 ARROWS. BUY FEWER.":GOSUB1:GOTO1600
1610 RS=RS+N:MO=MO-INT((N+1)/2)
1620 RETURN
1630 REM
1640 M$="HOW MANY SALVES WILT THOU BUY? THEY COST THEE 10 SILVER PIECES EACH.":GOSUB1:INPUTN
1641 IF10*N>MOTHENPRINT"NO CREDIT":GOTO1640
1642 MO=MO-10*N:HS=HS+N:IFHS>10THENN=HS-10:MO=MO+10*N:HS=10:M$="MORE THAN 10 WILL DO THEE NO GOOD":GOSUB1
1650 IFMO<.35*OMTHENPRINTNM$;"! THOU SPENDTHRIFT!":M$="THOU HAST BUT"+STR$(MO)+" SILVER PIECES LEFT TO THEE":GOSUB1:GOTO1660
1651 M$=NM$+", THOU ART FRUGAL.":GOSUB1:GOSUB830
1660 D(499)=MO:RETURN
1670 IFRND(3)>2THENM$="WHAT BE THY OFFER "+NM$+"?":GOSUB1:GOTO1680
1671 PRINT"WHAT OFFEREST THOU?"
1680 INPUTOO:IFOO>MOTHENM$="LIAR, THOU HAST BUT"+STR$(MO):GOSUB1:GOTO1670
1690 IFOO=0THENLS=0:RETURN
1700 IFOO<=LOTHENGOSUB1950:GOTO1670
1710 IFOO<=LSTHENGOSUB1910:GOTO1670
1720 IFOO>=AKTHENPRINT"DONE":LS=0:RETURN
1730 IFOO>AK-.3*RND(0)^2*AKTHEN1735
1731 GOTO1740
1735 IFOO<.6*A1THENM$="THOU ART A HARD BARGAINER "+NM$:GOSUB1:LS=0:RETURN
1736 PRINT"DONE":LS=0:RETURN
1740 IFRND(200)=200THENPRINT"I SEE THE GODS LOOK WITH FAVOUR ON THEE, SO TAKE IT FOR THAT":LS=0:RETURN
1750 B=20/(CH(1)+CH(3)):IFCH(3)>12ANDCH(1)<10THENB=20/(CH(1)+20-CH(3))
1760 AK=OO+(AK-OO)*SQR(1-RND(0))*B
1770 LS=OO
1780 GOSUB1970:GOTO1670
1790 CH(1)=PEEK(KB+20):CH(2)=PEEK(KB+21):CH(3)=PEEK(KB+22):CH(4)=PEEK(KB+23):CH(5)=PEEK(KB+24):CH(6)=PEEK(KB+25)
1791 SM=PEEK(KB+10):RM=PEEK(KB+14):RS=PEEK(KB+13):AA=PEEK(KB+8):WM=PEEK(KB+7)-SM:WN=PEEK(KB+17)
1800 IFSM<>0THENWN=6
1810 GOSUB1980:CLS:PRINT"CHARACTER SUMMARY FOR "LEFT$(NM$,8)
1820 PRINT:FORI=1TO6STEP2:PRINTLEFT$(NC$(I),12)TAB(13);STR$(PEEK(KA-97+I));
1821 PRINTTAB(18)LEFT$(NC$(I+1),11)TAB(28);STR$(PEEK(KA-97+I+1)):NEXTI
1830 J=0:IFPEEK(KB)=3THENJ=1:GOTO1840
1831 IFPEEK(KB)=5THENJ=2
1840 PRINT"WEAPON: "NW$(WN);:IFWN=6THENPRINTTAB(20)"PLUS:";PEEK(KB+10):GOTO1850
1841 PRINT
1850 PRINT"ARMOUR: "NA$(AA);:IFPEEK(KB+16)>0THENPRINTTAB(20)"PLUS:";PEEK(KB+16):GOTO1860
1851 PRINT
1860 PRINT"SHIELD: "NS$(J)
1870 PRINT"ARROWS: "RS;TAB(18)"MAGIC:"RM
1880 PRINT"SALVES: ";PEEK(KB+11);TAB(18);"ELIXIRS:";PEEK(KB+6)
1890 PRINT"SILVER: "MO;TAB(18)"EXP:";D(498)
1895 PRINT"WEIGHT:";PEEK(KB+12)
1900 RETURN
1910 R=RND(3):R=RND(3):ONRND(3)GOTO1920,1930,1940
1920 M$="DOST THOU TAKE ME FOR A DOLT?":GOSUB1:RETURN
1930 M$="FOOL OR KNAVE "+NM$+"! MAKE AN OFFER HIGHER THAN THY LAST":GOSUB1:RETURN
1940 M$="PERCHANCE THOU WOULDST NOT HAVE THIS AT ALL?":GOSUB1:RETURN
1950 IFRND(100)>50THENM$="HA! 'TIS LESS THAN I PAID FOR IT":GOSUB1:RETURN
1951 M$="I SPIT ON THY PALTRY OFFER":GOSUB1:RETURN
1970 FORI1=1TO10:R=RND(RT):NEXTI1:RQ=0:R=RND(RT)-1:FORI1=1TORN:RQ=RQ+RR(I1)
1971 IFRQ<RTHENNEXTI1:GOTO1980
1972 M$=R$(I1)+STR$(INT(AK+.999)):GOSUB1:RETURN
1980 NM$="":FORI=1TO11:NM$=NM$+CHR$(PEEK(KB-12+I)):NEXTI
1990 FORI=1TO10:IFMID$(NM$,12-I,1)<>" "GOTO2010
2000 NEXTI
2010 NM$=LEFT$(NM$,12-I):RETURN
2020 SM=PEEK(KB+10):HS=PEEK(KB+11):HN=PEEK(KB+6):RS=PEEK(KB+13):RM=PEEK(KB+14):FORI=1TO6:CH(I)=PEEK(KB+19+I):NEXTI
2021 AA=PEEK(KB+8):WM=PEEK(KB+7):PS=PEEK(KB):WC=PEEK(KB+12):IFAA=5THENW2=1:GOTO2030
2022 W2=0
2030 EX=D(498):IFEX>1999THENL=LOG(EX/1000)/LOG(2)+1:GOTO2040
2031 L=1
2040 HB=1:GOSUB1120:GOSUB910
2050 RETURN
2060 GOSUB1980:CLS:PRINT"TREASURES FOR "NM$:PRINT"TREASURE"TAB(11);"#"TAB(16);"TREASURE"TAB(26);"#"
2070 FORI=1TO20STEP2:PRINTI;TAB(10);PEEK(KA-81+I);TAB(15);I+1;TAB(25);PEEK(KA-80+I):NEXTI
2071 INPUT"ART THOU READY FOR MORE";A$:RETURN
2080 FORI=1TO20:D(499)=D(499)+(T(I,D(500))*PEEK(KA-81+I)):NEXTI:MO=D(499)
2090 M$="THOU HAST"+STR$(MO)+" SILVER PIECES.":GOSUB1:RETURN
3000 DATA 0,800,100,2000,30,50,150,0,5,1250,200,8900,0,0,0,650,5,540,250,12600,6,0,0,0,5,410,200,0,40,0,400,5000
3008 DATA 1,600,200,2150,500,1160,300,500,800,900,100,300,400,500,300,10000,700,0,0,2000,1,0,0,800,20,0,0,0
3015 DATA 0,0,0,0,20,0,0,0,500,0,0,0,0,0,0,0,0,0,0,0
